import { request } from "@/utils/request";

// 平台登录
export function login(
  username: string,
  password: string
): Promise<RequestResponse<loginInfo>> {
  const data = {
    username,
    password,
  };
  return request({
    url: "/login",
    method: "POST",
    data,
  });
}
// 微信登录
export function wxLogin(code: string): Promise<RequestResponse<loginInfo>> {
  const data = {
    code,
  };
  return request({
    url: "/wxLogin",
    method: "POST",
    data,
  });
}

// 获取用户详细信息
export function getInfo(): Promise<RequestResponse<UserInfo>> {
  return request({
    url: "/getInfo",
    method: "GET",
  });
}
